package com.yu.oss.controller;

import com.yu.oss.service.FileService;
import com.yu.oss.service.StorageService;
import com.yu.oss.util.MinioUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 路亚
 * @version 0.1
 * @className FileController
 * @description
 * @date 2025/1/9 19:38
 * @since jdk11
 */
@RestController
@RefreshScope
public class FileController {

    @Resource
    private FileService fileService;

    @Value("${storage.type}")
    private String storageType;

    @RequestMapping("/testGetAllBucket")
    public String testGetAllBucket() throws Exception {
        List<String> allBucket = fileService.getAllBucket();
        return allBucket.toString() + storageType;
    }
}
